{% if is_paginated %}
{% load i18n %}
<ul class="pagination custom-pagination">
  {% block previouslink %}
  {% if page_obj.has_previous %}
  {% if disable_link_for_first_page and page_obj.previous_page_number == 1 %}
  <li class="prev"><a href="{{ request.path }}{% if getvars %}?{{ getvars|slice:"1:" }}{% endif %}">{{ previous_link_decorator|safe }}{% trans "Prev" %}</a></li>
  {% else %}
  <li class="prev"><a href="?page{{ page_suffix }}={{ page_obj.previous_page_number }}{{ getvars }}" class="prev">{{ previous_link_decorator|safe }}{% trans "previous" %}</a></li>
  {% endif %}
  {% else %}
  {% if display_disabled_previous_link %}
  <li class="prev">{{ previous_link_decorator|safe }}{% trans "Prev" %}</li>
  {% endif %}
  {% endif %}
  {% endblock previouslink %}
  {% block pagelinks %}
  {% if display_page_links %}
  {% for page in pages %}
  {% if page %}
  {% ifequal page page_obj.number %}
  <li class="active"><a href="?page{{ page_suffix }}={{ page }}{{ getvars }}" >{{ page }}</a></li>
  {% else %}
  {% if disable_link_for_first_page and page == 1 %}
  <li><a href="{{ request.path }}{% if getvars %}?{{ getvars|slice:"1:" }}{% endif %}" class="page">{{ page }}</a></li>
  {% else %}
  <li><a href="?page{{ page_suffix }}={{ page }}{{ getvars }}" class="page">{{ page }}</a></li>
  {% endif %}
  {% endifequal %}
  {% else %}
  <li>...</li>
  {% endif %}
  {% endfor %}
  {% endif %}
  {% endblock pagelinks %}
  {% block nextlink %}
  {% if page_obj.has_next %}
  <li class="next"><a href="?page{{ page_suffix }}={{ page_obj.next_page_number }}{{ getvars }}" class="next">{% trans "Next" %}{{ next_link_decorator|safe }}</a></li>
  {% else %}
  {% if display_disabled_next_link %}
  <li class="next"><span class="disabled next">{% trans "next" %}{{ next_link_decorator|safe }}</span></li>
  {% endif %}
  {% endif %}
  {% endblock nextlink %}
</div>
{% endif %}
